package com.homegoods.orderinfodetail.item;

import android.text.Html;
import android.text.Spanned;
import android.view.View;

import com.homegoods.classify.model.Constant;
import com.homegoods.orderinfodetail.R;
import com.homegoods.orderinfodetail.model.ShopDetailGoodsModel;
import com.kedll.library.mvp.BaseItem;


public class ShopDetailGoodsItem extends BaseItem<ShopDetailGoodsModel> {
    public ShopDetailGoodsItem(ShopDetailGoodsModel data) {
        super(data);
    }

    public String getImgUrl() {
        return Constant.SERVER_URL + getData().getBgimg();
    }

    public Spanned getTitle() {
        return Html.fromHtml(getData().getTitle());
//        return getData().getTitle();
    }

    public String getPrice() {
        return String.format("￥%s", getData().getCurrentprice());
    }

    public String getActPrice() {
        return String.format("￥%s", getData().getCurrentprice());
    }

    public int isShowActPrice() {
        return View.VISIBLE;
    }

    public String getDayang() {
        return String.format("%s积分", getData().getOceannum());

    }

    public String getShopName() {
        return getData().getShopname();
    }

    public String getPayNum() {
        return String.format("%s人付款", getData().getQuantity());
    }

    public int isExplode() {

        //TODO
//        return (getData().getLabel2() == 0) ? View.VISIBLE : View.GONE;
        return View.GONE;
    }

    @Override
    public int getLayout() {
        return R.layout.item_shopdetail_goods;
    }
}
